
<%@page import="dto.DTO_KhachHang"%>
<%@page import="dto.DTO_KhachHang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<%
    if(session.getAttribute("KhachHang") == null)
    {
            response.sendRedirect("dangnhap.jsp");
    }
    else
    {
           dto.DTO_KhachHang kh = new DTO_KhachHang();
           kh = (DTO_KhachHang)session.getAttribute("KhachHang");
           if(kh.getQuyenHan()!= 1)
               {
                    response.sendRedirect("dangnhap.jsp");
               }
    }

%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Quản Lý Thống Kê</title>
        <link type="text/css" rel="stylesheet" href="css/style.css" />
        <script type="text/javascript" src="js/jquery-1.5.2.js"></script>
        <script type="text/javascript" src="js/myJS.js"></script>
        <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>

    </head>
    <body>
         <div id="top-background">
             <div id="page-container">
                 <jsp:include page="template/header.jsp"></jsp:include>
                 <jsp:include page="template/adminpage_menu.jsp"></jsp:include>
                 <div id="main-content">
                     <div style="margin-left: 20px;">
                         Số Dòng Danh Sách :
                         <s:form theme="simple" method="POST" action="ThongKe">
                         <s:textfield theme="simple"  name="sl" cssStyle="width:50px;" value="%{sl} "></s:textfield>
                         <s:submit theme="simple" value="Xác Nhận" name="submit"></s:submit>
                         </s:form>
                         <br>
                     <div id="thongke" >
                         <div id ="tongdoanhthu">
                         <p>Tổng Doanh Thu</p>
                         <table>
                             <tr>
                                 <td style="font-weight: bold ; text-align: right;">Số Sản Phẩm Bán :</td>
                                 <td ><s:property value="tongsanphamban" /></td>
                             </tr>
                             <tr>
                                 <td style="font-weight: bold; text-align: right;">Doanh Thu :</td>
                                 <td><s:property value="tongdoanhthu" /><span style="margin-left: 5px;">VND</span></td>
                             </tr>
                         </table>
                         </div>
                             <br>
                             <div id="sanphambc">
                         <p>Sản Phẩm Được ưa chuộng</p><br>
                         <table>
                             <tr style="color: white; background-color: black;">
                                 <td>Mã Sản Phẩm</td>
                                 <td>Tên Sản Phẩm</td>
                                 <td>Số Lượn Bán Ra</td>
                                 <td>Doanh Thu</td>
                                 <td>%Doanh Thu</td>
                             </tr>
                             
                         <s:iterator value="dsbc" status="dsbcStartus">
                             <tr>
                                 <td><s:property value="MaSP" /></td>
                                 <td><s:property value="TenSP" /></td>                                 
                                 <td><s:property value="soluongban"/></td>
                                 <td><s:property value="doanhthu" /></td>
                                 <td><s:property value="phantran" /><span style="margin-left: 5px;">%</span></td>
                             </tr>
                         </s:iterator>
                         </table>
                         <br>
                         <div id="khachhangmuanhieu">
                         <p>Khách Hàng Mua Nhiều</p>
                         <br>
                         <table>
                             <tr style="color: white; background-color: black;">
                                 <td> Mã Khách Hàng</td>
                                 <td> Tên Khách Hàng</td>
                                 <td> Số Điện Thoại </td>
                                 <td> Email</td>
                             </tr>
                              <s:iterator value="dskh" status="dskhStartus">
                             <tr>
                                 <td><s:property value="MaKH" /></td>
                                 <td><s:property value="HoTen" /></td>
                                 <td><s:property value="DienThoai"/></td>
                                 <td><s:property value="Email" /></td>
                             </tr>
                         </s:iterator>
                         </table>
                         </div>
                         <br>
                     </div>
                     </div>
                </div>
                 <div style="clear: both;"></div>
                 <jsp:include page="template/footer.jsp"></jsp:include>
             </div>
        </div>
         </div>
    </body>
</html>
